package com.baseweb.webadmin.core.model.bvo;

import com.baseweb.webadmin.core.model.pojo.ByUserOrder;
import com.baseweb.webadmin.core.model.pojo.ByUserOrderDetail;
import com.baseweb.webadmin.core.model.pojo.User;
import com.baseweb.webadmin.core.util.DateUtil;
import org.joda.time.DateTime;

import java.math.BigDecimal;

public class OrderCommentBvo {

    private Integer orderId;
    private Integer userId;
    private User user;
    private Integer userStar;
    private Integer bizStar;
    private String userComment;
    private String bizComment;

    public static OrderCommentBvo copyFrom(ByUserOrder order, User user) {
        OrderCommentBvo bvo = new OrderCommentBvo();
        bvo.setOrderId(order.getId());
        bvo.setUserId(order.getUserId());
        bvo.setUser(user);
        if (order.getBizStars() != null) {
            bvo.setBizStar(Integer.valueOf(order.getBizStars()));
        }
        if (order.getUserStars() != null) {
            bvo.setUserStar(Integer.valueOf(order.getUserStars()));
        }
        bvo.setUserComment(order.getUserComment());
        bvo.setBizComment(order.getBizComment());
        return bvo;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Integer getUserStar() {
        return userStar;
    }

    public void setUserStar(Integer userStar) {
        this.userStar = userStar;
    }

    public String getUserComment() {
        return userComment;
    }

    public void setUserComment(String userComment) {
        this.userComment = userComment;
    }

    public Integer getBizStar() {
        return bizStar;
    }

    public void setBizStar(Integer bizStar) {
        this.bizStar = bizStar;
    }

    public String getBizComment() {
        return bizComment;
    }

    public void setBizComment(String bizComment) {
        this.bizComment = bizComment;
    }
}
